package lsl.leetCode.year2023.test0205;

/**
 * 392.判断子序列
 *
 * @author Zed
 * @description
 * @date 2023/2/5 19:34
 */
public class test392 {
    public static void main(String[] args) {

    }

    public static boolean isSubsequence(String s, String t) {
        if (s.equals(t)) {
            return true;
        }
        int j = 0;
        for (int i = 0; i < t.length(); i++) {
            if (j < s.length()) {
                if (t.charAt(i) == s.charAt(j)) {
                    j++;
                }
            }
        }
        if (j == s.length()) {
            return true;
        }
        return false;
    }
}
